{% extends "VavilenFirstBundle::Admin/layout.html.twig" %}

{% block content %}
    <div class="admin-table">
        <table>
            <thead>
                <th>Пост</th>
                <th>Категория</th>
                <th>Teги</th>
                <th></th>
                <th></th>
            </thead>
            <tbody>
            {% for item in posts %}
                <tr>
                    <td>{{ item.title }}</td>
                    <td><a href="{{ path('admin_edit_category', {'categoryId' : item.id } ) }}">{{ item.category.categoryName }}</a></td>
                    <td>
                        {% for tag in item.tags %}
                            <div>{{ tag.tagName }}</div>
                        {% endfor %}
                    </td>
                    <td><a href="{{ path('admin_edit_post', {'postId' : item.id } ) }}">Редактировать</a></td>
                    <td><a href="{{ path('admin_remove_post', {'postId' : item.id } ) }}">Удалить</a></td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
{% endblock %}
